<!-- HTML header for doxygen 1.8.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/xhtml;charset=utf-8" http-equiv="Content-Type"/>
<meta content="IE=9" http-equiv="X-UA-Compatible"/>
<meta content="Doxygen 1.8.13" name="generator"/>
<title>OpenCV: Image Filtering</title>
<link href="../../opencv.ico" rel="shortcut icon" type="image/x-icon"/>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script src="../../jquery.js" type="text/javascript"></script>
<script src="../../dynsections.js" type="text/javascript"></script>
<script src="../../tutorial-utils.js" type="text/javascript"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script src="../../search/searchdata.js" type="text/javascript"></script>
<script src="../../search/search.js" type="text/javascript"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
//<![CDATA[
MathJax.Hub.Config(
{
  TeX: {
      Macros: {
          matTT: [ "\\[ \\left|\\begin{array}{ccc} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{array}\\right| \\]", 9],
          fork: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ \\end{array} \\right.", 4],
          forkthree: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ \\end{array} \\right.", 6],
          forkfour: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ #7 & \\mbox{#8}\\\\ \\end{array} \\right.", 8],
          vecthree: ["\\begin{bmatrix} #1\\\\ #2\\\\ #3 \\end{bmatrix}", 3],
          vecthreethree: ["\\begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{bmatrix}", 9],
          cameramatrix: ["#1 = \\begin{bmatrix} f_x & 0 & c_x\\\\ 0 & f_y & c_y\\\\ 0 & 0 & 1 \\end{bmatrix}", 1],
          distcoeffs: ["(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]]) \\text{ of 4, 5, 8, 12 or 14 elements}"],
          distcoeffsfisheye: ["(k_1, k_2, k_3, k_4)"],
          hdotsfor: ["\\dots", 1],
          mathbbm: ["\\mathbb{#1}", 1],
          bordermatrix: ["\\matrix{#1}", 1]
      }
  }
}
);
//]]>
</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js" type="text/javascript"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css"/>
<link href="../../stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<!--#include virtual="/google-search.html"-->
<table cellpadding="0" cellspacing="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../opencv-logo-small.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenCV
    <span id="projectnumber">4.5.2</span>
   </div>
   <div id="projectbrief">Open Source Computer Vision</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
<script src="../../menudata.js" type="text/javascript"></script>
<script src="../../menu.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow" onkeydown="return searchBox.OnSearchSelectKey(event)" onmouseout="return searchBox.OnSearchSelectHide()" onmouseover="return searchBox.OnSearchSelectShow()">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe frameborder="0" id="MSearchResults" name="MSearchResults" src="javascript:void(0)">
</iframe>
</div>
<div class="header">
  <div class="summary">
<a href="#enum-members">Enumerations</a> |
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Image Filtering<div class="ingroups"><a class="el" href="../../d7/dbd/group__imgproc.html">Image Processing</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:gac2db39b56866583a95a5680313c314ad"><td align="right" class="memItemLeft" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d86/group__imgproc__filter.html#gac2db39b56866583a95a5680313c314ad">cv::MorphShapes</a> { <br/>
  <a class="el" href="../../d4/d86/group__imgproc__filter.html#ggac2db39b56866583a95a5680313c314ada260c4cbde19a749726763c01a074c60f">cv::MORPH_RECT</a> = 0, 
<br/>
  <a class="el" href="../../d4/d86/group__imgproc__filter.html#ggac2db39b56866583a95a5680313c314ada318435753d0b9f7faa241a658ec2e191">cv::MORPH_CROSS</a> = 1, 
<br/>
  <a class="el" href="../../d4/d86/group__imgproc__filter.html#ggac2db39b56866583a95a5680313c314ada33a3c67a61f349d21c507d05c53a755f">cv::MORPH_ELLIPSE</a> = 2
<br/>
 }<tr class="memdesc:gac2db39b56866583a95a5680313c314ad"><td class="mdescLeft"> </td><td class="mdescRight">shape of the structuring element  <a href="../../d4/d86/group__imgproc__filter.html#gac2db39b56866583a95a5680313c314ad">More...</a><br/></td></tr>
</td></tr>
<tr class="separator:gac2db39b56866583a95a5680313c314ad"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga7be549266bad7b2e6a04db49827f9f32"><td align="right" class="memItemLeft" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d86/group__imgproc__filter.html#ga7be549266bad7b2e6a04db49827f9f32">cv::MorphTypes</a> { <br/>
  <a class="el" href="../../d4/d86/group__imgproc__filter.html#gga7be549266bad7b2e6a04db49827f9f32aa3783a21b429f4c31c178264a0403fcd">cv::MORPH_ERODE</a> = 0, 
<br/>
  <a class="el" href="../../d4/d86/group__imgproc__filter.html#gga7be549266bad7b2e6a04db49827f9f32a2b9f6b6fb168b4d1d5277caebfe7b73d">cv::MORPH_DILATE</a> = 1, 
<br/>
  <a class="el" href="../../d4/d86/group__imgproc__filter.html#gga7be549266bad7b2e6a04db49827f9f32a08d3cc3a2ace00cec488966d31fa29ea">cv::MORPH_OPEN</a> = 2, 
<br/>
  <a class="el" href="../../d4/d86/group__imgproc__filter.html#gga7be549266bad7b2e6a04db49827f9f32a68c4b9c6144a30bcd52d1cdf39bb30e1">cv::MORPH_CLOSE</a> = 3, 
<br/>
  <a class="el" href="../../d4/d86/group__imgproc__filter.html#gga7be549266bad7b2e6a04db49827f9f32a887efd64e82cee95a62f851c7f3b617b">cv::MORPH_GRADIENT</a> = 4, 
<br/>
  <a class="el" href="../../d4/d86/group__imgproc__filter.html#gga7be549266bad7b2e6a04db49827f9f32ada67be24f4dce6d7e6c57527f8724f3b">cv::MORPH_TOPHAT</a> = 5, 
<br/>
  <a class="el" href="../../d4/d86/group__imgproc__filter.html#gga7be549266bad7b2e6a04db49827f9f32a24d27f56df6b98b1cb92ae8108d4638f">cv::MORPH_BLACKHAT</a> = 6, 
<br/>
  <a class="el" href="../../d4/d86/group__imgproc__filter.html#gga7be549266bad7b2e6a04db49827f9f32acf55ff766595ec0174ba42852f0ac264">cv::MORPH_HITMISS</a> = 7
<br/>
 }<tr class="memdesc:ga7be549266bad7b2e6a04db49827f9f32"><td class="mdescLeft"> </td><td class="mdescRight">type of morphological operation  <a href="../../d4/d86/group__imgproc__filter.html#ga7be549266bad7b2e6a04db49827f9f32">More...</a><br/></td></tr>
</td></tr>
<tr class="separator:ga7be549266bad7b2e6a04db49827f9f32"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gad8e695e87dee497e227716576c244598"><td align="right" class="memItemLeft" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d86/group__imgproc__filter.html#gad8e695e87dee497e227716576c244598">cv::SpecialFilter</a> { <a class="el" href="../../d4/d86/group__imgproc__filter.html#ggad8e695e87dee497e227716576c244598a460c815d2bb921fb7f53f4220e19c1d5">cv::FILTER_SCHARR</a> = -1
 }</td></tr>
<tr class="separator:gad8e695e87dee497e227716576c244598"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga9d7064d478c95d60003cf839430737ed"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d86/group__imgproc__filter.html#ga9d7064d478c95d60003cf839430737ed">cv::bilateralFilter</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst, int d, double sigmaColor, double sigmaSpace, int borderType=<a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a>)</td></tr>
<tr class="memdesc:ga9d7064d478c95d60003cf839430737ed"><td class="mdescLeft"> </td><td class="mdescRight">Applies the bilateral filter to an image.  <a href="../../d4/d86/group__imgproc__filter.html#ga9d7064d478c95d60003cf839430737ed">More...</a><br/></td></tr>
<tr class="separator:ga9d7064d478c95d60003cf839430737ed"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga8c45db9afe636703801b0b2e440fce37"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d86/group__imgproc__filter.html#ga8c45db9afe636703801b0b2e440fce37">cv::blur</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst, <a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> ksize, <a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> anchor=<a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>(-1,-1), int borderType=<a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a>)</td></tr>
<tr class="memdesc:ga8c45db9afe636703801b0b2e440fce37"><td class="mdescLeft"> </td><td class="mdescRight">Blurs an image using the normalized box filter.  <a href="../../d4/d86/group__imgproc__filter.html#ga8c45db9afe636703801b0b2e440fce37">More...</a><br/></td></tr>
<tr class="separator:ga8c45db9afe636703801b0b2e440fce37"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gad533230ebf2d42509547d514f7d3fbc3"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d86/group__imgproc__filter.html#gad533230ebf2d42509547d514f7d3fbc3">cv::boxFilter</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst, int ddepth, <a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> ksize, <a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> anchor=<a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>(-1,-1), bool <a class="el" href="../../dc/d84/group__core__basic.html#ga1b6a396a456c8b6c6e4afd8591560d80">normalize</a>=true, int borderType=<a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a>)</td></tr>
<tr class="memdesc:gad533230ebf2d42509547d514f7d3fbc3"><td class="mdescLeft"> </td><td class="mdescRight">Blurs an image using the box filter.  <a href="../../d4/d86/group__imgproc__filter.html#gad533230ebf2d42509547d514f7d3fbc3">More...</a><br/></td></tr>
<tr class="separator:gad533230ebf2d42509547d514f7d3fbc3"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gacfdda2bc1ac55e96de7e9f0bce7238c0"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d86/group__imgproc__filter.html#gacfdda2bc1ac55e96de7e9f0bce7238c0">cv::buildPyramid</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#ga889a09549b98223016170d9b613715de">OutputArrayOfArrays</a> dst, int maxlevel, int borderType=<a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a>)</td></tr>
<tr class="memdesc:gacfdda2bc1ac55e96de7e9f0bce7238c0"><td class="mdescLeft"> </td><td class="mdescRight">Constructs the Gaussian pyramid for an image.  <a href="../../d4/d86/group__imgproc__filter.html#gacfdda2bc1ac55e96de7e9f0bce7238c0">More...</a><br/></td></tr>
<tr class="separator:gacfdda2bc1ac55e96de7e9f0bce7238c0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga4ff0f3318642c4f469d0e11f242f3b6c"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d86/group__imgproc__filter.html#ga4ff0f3318642c4f469d0e11f242f3b6c">cv::dilate</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> kernel, <a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> anchor=<a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>(-1,-1), int iterations=1, int borderType=<a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5aed2e4346047e265c8c5a6d0276dcd838">BORDER_CONSTANT</a>, const <a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a> &amp;borderValue=<a class="el" href="../../d4/d86/group__imgproc__filter.html#ga94756fad83d9d24d29c9bf478558c40a">morphologyDefaultBorderValue</a>())</td></tr>
<tr class="memdesc:ga4ff0f3318642c4f469d0e11f242f3b6c"><td class="mdescLeft"> </td><td class="mdescRight">Dilates an image by using a specific structuring element.  <a href="../../d4/d86/group__imgproc__filter.html#ga4ff0f3318642c4f469d0e11f242f3b6c">More...</a><br/></td></tr>
<tr class="separator:ga4ff0f3318642c4f469d0e11f242f3b6c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaeb1e0c1033e3f6b891a25d0511362aeb"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d86/group__imgproc__filter.html#gaeb1e0c1033e3f6b891a25d0511362aeb">cv::erode</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> kernel, <a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> anchor=<a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>(-1,-1), int iterations=1, int borderType=<a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5aed2e4346047e265c8c5a6d0276dcd838">BORDER_CONSTANT</a>, const <a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a> &amp;borderValue=<a class="el" href="../../d4/d86/group__imgproc__filter.html#ga94756fad83d9d24d29c9bf478558c40a">morphologyDefaultBorderValue</a>())</td></tr>
<tr class="memdesc:gaeb1e0c1033e3f6b891a25d0511362aeb"><td class="mdescLeft"> </td><td class="mdescRight">Erodes an image by using a specific structuring element.  <a href="../../d4/d86/group__imgproc__filter.html#gaeb1e0c1033e3f6b891a25d0511362aeb">More...</a><br/></td></tr>
<tr class="separator:gaeb1e0c1033e3f6b891a25d0511362aeb"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga27c049795ce870216ddfb366086b5a04"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d86/group__imgproc__filter.html#ga27c049795ce870216ddfb366086b5a04">cv::filter2D</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst, int ddepth, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> kernel, <a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> anchor=<a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>(-1,-1), double delta=0, int borderType=<a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a>)</td></tr>
<tr class="memdesc:ga27c049795ce870216ddfb366086b5a04"><td class="mdescLeft"> </td><td class="mdescRight">Convolves an image with the kernel.  <a href="../../d4/d86/group__imgproc__filter.html#ga27c049795ce870216ddfb366086b5a04">More...</a><br/></td></tr>
<tr class="separator:ga27c049795ce870216ddfb366086b5a04"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaabe8c836e97159a9193fb0b11ac52cf1"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d86/group__imgproc__filter.html#gaabe8c836e97159a9193fb0b11ac52cf1">cv::GaussianBlur</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst, <a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> ksize, double sigmaX, double sigmaY=0, int borderType=<a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a>)</td></tr>
<tr class="memdesc:gaabe8c836e97159a9193fb0b11ac52cf1"><td class="mdescLeft"> </td><td class="mdescRight">Blurs an image using a Gaussian filter.  <a href="../../d4/d86/group__imgproc__filter.html#gaabe8c836e97159a9193fb0b11ac52cf1">More...</a><br/></td></tr>
<tr class="separator:gaabe8c836e97159a9193fb0b11ac52cf1"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga6d6c23f7bd3f5836c31cfae994fc4aea"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d86/group__imgproc__filter.html#ga6d6c23f7bd3f5836c31cfae994fc4aea">cv::getDerivKernels</a> (<a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> kx, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> ky, int dx, int dy, int ksize, bool <a class="el" href="../../dc/d84/group__core__basic.html#ga1b6a396a456c8b6c6e4afd8591560d80">normalize</a>=false, int ktype=<a class="el" href="../../d1/d1b/group__core__hal__interface.html#ga4a3def5d72b74bed31f5f8ab7676099c">CV_32F</a>)</td></tr>
<tr class="memdesc:ga6d6c23f7bd3f5836c31cfae994fc4aea"><td class="mdescLeft"> </td><td class="mdescRight">Returns filter coefficients for computing spatial image derivatives.  <a href="../../d4/d86/group__imgproc__filter.html#ga6d6c23f7bd3f5836c31cfae994fc4aea">More...</a><br/></td></tr>
<tr class="separator:ga6d6c23f7bd3f5836c31cfae994fc4aea"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gae84c92d248183bd92fa713ce51cc3599"><td align="right" class="memItemLeft" valign="top"><a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d86/group__imgproc__filter.html#gae84c92d248183bd92fa713ce51cc3599">cv::getGaborKernel</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> ksize, double sigma, double theta, double lambd, double gamma, double psi=<a class="el" href="../../db/de0/group__core__utils.html#ga677b89fae9308b340ddaebf0dba8455f">CV_PI</a> *0.5, int ktype=<a class="el" href="../../d1/d1b/group__core__hal__interface.html#ga30a562691cc5987bc88eb7bb7a8faf2b">CV_64F</a>)</td></tr>
<tr class="memdesc:gae84c92d248183bd92fa713ce51cc3599"><td class="mdescLeft"> </td><td class="mdescRight">Returns Gabor filter coefficients.  <a href="../../d4/d86/group__imgproc__filter.html#gae84c92d248183bd92fa713ce51cc3599">More...</a><br/></td></tr>
<tr class="separator:gae84c92d248183bd92fa713ce51cc3599"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gac05a120c1ae92a6060dd0db190a61afa"><td align="right" class="memItemLeft" valign="top"><a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d86/group__imgproc__filter.html#gac05a120c1ae92a6060dd0db190a61afa">cv::getGaussianKernel</a> (int ksize, double sigma, int ktype=<a class="el" href="../../d1/d1b/group__core__hal__interface.html#ga30a562691cc5987bc88eb7bb7a8faf2b">CV_64F</a>)</td></tr>
<tr class="memdesc:gac05a120c1ae92a6060dd0db190a61afa"><td class="mdescLeft"> </td><td class="mdescRight">Returns Gaussian filter coefficients.  <a href="../../d4/d86/group__imgproc__filter.html#gac05a120c1ae92a6060dd0db190a61afa">More...</a><br/></td></tr>
<tr class="separator:gac05a120c1ae92a6060dd0db190a61afa"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gac342a1bb6eabf6f55c803b09268e36dc"><td align="right" class="memItemLeft" valign="top"><a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d86/group__imgproc__filter.html#gac342a1bb6eabf6f55c803b09268e36dc">cv::getStructuringElement</a> (int shape, <a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> ksize, <a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> anchor=<a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>(-1,-1))</td></tr>
<tr class="memdesc:gac342a1bb6eabf6f55c803b09268e36dc"><td class="mdescLeft"> </td><td class="mdescRight">Returns a structuring element of the specified size and shape for morphological operations.  <a href="../../d4/d86/group__imgproc__filter.html#gac342a1bb6eabf6f55c803b09268e36dc">More...</a><br/></td></tr>
<tr class="separator:gac342a1bb6eabf6f55c803b09268e36dc"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gad78703e4c8fe703d479c1860d76429e6"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d86/group__imgproc__filter.html#gad78703e4c8fe703d479c1860d76429e6">cv::Laplacian</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst, int ddepth, int ksize=1, double scale=1, double delta=0, int borderType=<a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a>)</td></tr>
<tr class="memdesc:gad78703e4c8fe703d479c1860d76429e6"><td class="mdescLeft"> </td><td class="mdescRight">Calculates the Laplacian of an image.  <a href="../../d4/d86/group__imgproc__filter.html#gad78703e4c8fe703d479c1860d76429e6">More...</a><br/></td></tr>
<tr class="separator:gad78703e4c8fe703d479c1860d76429e6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga564869aa33e58769b4469101aac458f9"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d86/group__imgproc__filter.html#ga564869aa33e58769b4469101aac458f9">cv::medianBlur</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst, int ksize)</td></tr>
<tr class="memdesc:ga564869aa33e58769b4469101aac458f9"><td class="mdescLeft"> </td><td class="mdescRight">Blurs an image using the median filter.  <a href="../../d4/d86/group__imgproc__filter.html#ga564869aa33e58769b4469101aac458f9">More...</a><br/></td></tr>
<tr class="separator:ga564869aa33e58769b4469101aac458f9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga94756fad83d9d24d29c9bf478558c40a"><td align="right" class="memItemLeft" valign="top">static <a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d86/group__imgproc__filter.html#ga94756fad83d9d24d29c9bf478558c40a">cv::morphologyDefaultBorderValue</a> ()</td></tr>
<tr class="memdesc:ga94756fad83d9d24d29c9bf478558c40a"><td class="mdescLeft"> </td><td class="mdescRight">returns "magic" border value for erosion and dilation. It is automatically transformed to <a class="el" href="../../d1/da0/classcv_1_1Scalar__.html#ac1509a4b8454fe7fe29db069e13a2e6f" title="returns a scalar with all elements set to v0 ">Scalar::all</a>(-DBL_MAX) for dilation.  <a href="../../d4/d86/group__imgproc__filter.html#ga94756fad83d9d24d29c9bf478558c40a">More...</a><br/></td></tr>
<tr class="separator:ga94756fad83d9d24d29c9bf478558c40a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga67493776e3ad1a3df63883829375201f"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d86/group__imgproc__filter.html#ga67493776e3ad1a3df63883829375201f">cv::morphologyEx</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst, int op, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> kernel, <a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> anchor=<a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>(-1,-1), int iterations=1, int borderType=<a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5aed2e4346047e265c8c5a6d0276dcd838">BORDER_CONSTANT</a>, const <a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a> &amp;borderValue=<a class="el" href="../../d4/d86/group__imgproc__filter.html#ga94756fad83d9d24d29c9bf478558c40a">morphologyDefaultBorderValue</a>())</td></tr>
<tr class="memdesc:ga67493776e3ad1a3df63883829375201f"><td class="mdescLeft"> </td><td class="mdescRight">Performs advanced morphological transformations.  <a href="../../d4/d86/group__imgproc__filter.html#ga67493776e3ad1a3df63883829375201f">More...</a><br/></td></tr>
<tr class="separator:ga67493776e3ad1a3df63883829375201f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaf9bba239dfca11654cb7f50f889fc2ff"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d86/group__imgproc__filter.html#gaf9bba239dfca11654cb7f50f889fc2ff">cv::pyrDown</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst, const <a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> &amp;dstsize=<a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a>(), int borderType=<a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a>)</td></tr>
<tr class="memdesc:gaf9bba239dfca11654cb7f50f889fc2ff"><td class="mdescLeft"> </td><td class="mdescRight">Blurs an image and downsamples it.  <a href="../../d4/d86/group__imgproc__filter.html#gaf9bba239dfca11654cb7f50f889fc2ff">More...</a><br/></td></tr>
<tr class="separator:gaf9bba239dfca11654cb7f50f889fc2ff"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga9fabdce9543bd602445f5db3827e4cc0"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d86/group__imgproc__filter.html#ga9fabdce9543bd602445f5db3827e4cc0">cv::pyrMeanShiftFiltering</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst, double sp, double sr, int maxLevel=1, <a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html">TermCriteria</a> termcrit=<a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html">TermCriteria</a>(<a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html#a56fecdc291ccaba8aad27d67ccf72c57a56ca2bc5cd06345060a1c1c66a8fc06e">TermCriteria::MAX_ITER</a>+<a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html#a56fecdc291ccaba8aad27d67ccf72c57a857609e73e7028e638d2ea649f3b45d5">TermCriteria::EPS</a>, 5, 1))</td></tr>
<tr class="memdesc:ga9fabdce9543bd602445f5db3827e4cc0"><td class="mdescLeft"> </td><td class="mdescRight">Performs initial step of meanshift segmentation of an image.  <a href="../../d4/d86/group__imgproc__filter.html#ga9fabdce9543bd602445f5db3827e4cc0">More...</a><br/></td></tr>
<tr class="separator:ga9fabdce9543bd602445f5db3827e4cc0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gada75b59bdaaca411ed6fee10085eb784"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d86/group__imgproc__filter.html#gada75b59bdaaca411ed6fee10085eb784">cv::pyrUp</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst, const <a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> &amp;dstsize=<a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a>(), int borderType=<a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a>)</td></tr>
<tr class="memdesc:gada75b59bdaaca411ed6fee10085eb784"><td class="mdescLeft"> </td><td class="mdescRight">Upsamples an image and then blurs it.  <a href="../../d4/d86/group__imgproc__filter.html#gada75b59bdaaca411ed6fee10085eb784">More...</a><br/></td></tr>
<tr class="separator:gada75b59bdaaca411ed6fee10085eb784"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaa13106761eedf14798f37aa2d60404c9"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d86/group__imgproc__filter.html#gaa13106761eedf14798f37aa2d60404c9">cv::Scharr</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst, int ddepth, int dx, int dy, double scale=1, double delta=0, int borderType=<a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a>)</td></tr>
<tr class="memdesc:gaa13106761eedf14798f37aa2d60404c9"><td class="mdescLeft"> </td><td class="mdescRight">Calculates the first x- or y- image derivative using Scharr operator.  <a href="../../d4/d86/group__imgproc__filter.html#gaa13106761eedf14798f37aa2d60404c9">More...</a><br/></td></tr>
<tr class="separator:gaa13106761eedf14798f37aa2d60404c9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga910e29ff7d7b105057d1625a4bf6318d"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d86/group__imgproc__filter.html#ga910e29ff7d7b105057d1625a4bf6318d">cv::sepFilter2D</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst, int ddepth, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> kernelX, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> kernelY, <a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> anchor=<a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>(-1,-1), double delta=0, int borderType=<a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a>)</td></tr>
<tr class="memdesc:ga910e29ff7d7b105057d1625a4bf6318d"><td class="mdescLeft"> </td><td class="mdescRight">Applies a separable linear filter to an image.  <a href="../../d4/d86/group__imgproc__filter.html#ga910e29ff7d7b105057d1625a4bf6318d">More...</a><br/></td></tr>
<tr class="separator:ga910e29ff7d7b105057d1625a4bf6318d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gacea54f142e81b6758cb6f375ce782c8d"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d86/group__imgproc__filter.html#gacea54f142e81b6758cb6f375ce782c8d">cv::Sobel</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst, int ddepth, int dx, int dy, int ksize=3, double scale=1, double delta=0, int borderType=<a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a>)</td></tr>
<tr class="memdesc:gacea54f142e81b6758cb6f375ce782c8d"><td class="mdescLeft"> </td><td class="mdescRight">Calculates the first, second, third, or mixed image derivatives using an extended Sobel operator.  <a href="../../d4/d86/group__imgproc__filter.html#gacea54f142e81b6758cb6f375ce782c8d">More...</a><br/></td></tr>
<tr class="separator:gacea54f142e81b6758cb6f375ce782c8d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga405d03b20c782b65a4daf54d233239a2"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d86/group__imgproc__filter.html#ga405d03b20c782b65a4daf54d233239a2">cv::spatialGradient</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dx, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dy, int ksize=3, int borderType=<a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a>)</td></tr>
<tr class="memdesc:ga405d03b20c782b65a4daf54d233239a2"><td class="mdescLeft"> </td><td class="mdescRight">Calculates the first order image derivative in both x and y using a Sobel operator.  <a href="../../d4/d86/group__imgproc__filter.html#ga405d03b20c782b65a4daf54d233239a2">More...</a><br/></td></tr>
<tr class="separator:ga405d03b20c782b65a4daf54d233239a2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga76e863e7869912edbe88321253b72688"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d86/group__imgproc__filter.html#ga76e863e7869912edbe88321253b72688">cv::sqrBoxFilter</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst, int ddepth, <a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> ksize, <a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> anchor=<a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>(-1, -1), bool <a class="el" href="../../dc/d84/group__core__basic.html#ga1b6a396a456c8b6c6e4afd8591560d80">normalize</a>=true, int borderType=<a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a>)</td></tr>
<tr class="memdesc:ga76e863e7869912edbe88321253b72688"><td class="mdescLeft"> </td><td class="mdescRight">Calculates the normalized sum of squares of the pixel values overlapping the filter.  <a href="../../d4/d86/group__imgproc__filter.html#ga76e863e7869912edbe88321253b72688">More...</a><br/></td></tr>
<tr class="separator:ga76e863e7869912edbe88321253b72688"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a id="details" name="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Functions and classes described in this section are used to perform various linear or non-linear filtering operations on 2D images (represented as <a class="el" href="../../d3/d63/classcv_1_1Mat.html" title="n-dimensional dense array class ">Mat</a>'s). It means that for each pixel location \((x,y)\) in the source image (normally, rectangular), its neighborhood is considered and used to compute the response. In case of a linear filter, it is a weighted sum of pixel values. In case of morphological operations, it is the minimum or maximum values, and so on. The computed response is stored in the destination image at the same location \((x,y)\). It means that the output image will be of the same size as the input image. Normally, the functions support multi-channel arrays, in which case every channel is processed independently. Therefore, the output image will also have the same number of channels as the input one.</p>
<p>Another common feature of the functions and classes described in this section is that, unlike simple arithmetic functions, they need to extrapolate values of some non-existing pixels. For example, if you want to smooth an image using a Gaussian \(3 \times 3\) filter, then, when processing the left-most pixels in each row, you need pixels to the left of them, that is, outside of the image. You can let these pixels be the same as the left-most image pixels ("replicated
border" extrapolation method), or assume that all the non-existing pixels are zeros ("constant
border" extrapolation method), and so on. OpenCV enables you to specify the extrapolation method. For details, see <a class="el" href="../../d2/de8/group__core__array.html#ga209f2f4869e304c82d07739337eae7c5">BorderTypes</a></p>
<p><a class="anchor" id="filter_depths"></a></p><h3>Depth combinations</h3>
<table class="doxtable">
<tr>
<th>Input depth (<a class="el" href="../../d0/daf/group__projection.html#ga8b5e5413af41caf3f2a0bbf4cdf517a8" title="Returns the depth of a point transformed by a rigid transform. ">src.depth()</a>) </th><th>Output depth (ddepth)  </th></tr>
<tr>
<td>CV_8U </td><td>-1/CV_16S/CV_32F/CV_64F </td></tr>
<tr>
<td>CV_16U/CV_16S </td><td>-1/CV_32F/CV_64F </td></tr>
<tr>
<td>CV_32F </td><td>-1/CV_32F/CV_64F </td></tr>
<tr>
<td>CV_64F </td><td>-1/CV_64F </td></tr>
</table>
<dl class="section note"><dt>Note</dt><dd>when ddepth=-1, the output image will have the same depth as the source. </dd></dl>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="gac2db39b56866583a95a5680313c314ad"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac2db39b56866583a95a5680313c314ad">◆ </a></span>MorphShapes</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="../../d4/d86/group__imgproc__filter.html#gac2db39b56866583a95a5680313c314ad">cv::MorphShapes</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>shape of the structuring element </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggac2db39b56866583a95a5680313c314ada260c4cbde19a749726763c01a074c60f"></a>MORPH_RECT <div class="python_language">Python: cv.MORPH_RECT</div></td><td class="fielddoc"><p>a rectangular structuring element: </p><p class="formulaDsp">
\[E_{ij}=1\]
</p>
 </td></tr>
<tr><td class="fieldname"><a id="ggac2db39b56866583a95a5680313c314ada318435753d0b9f7faa241a658ec2e191"></a>MORPH_CROSS <div class="python_language">Python: cv.MORPH_CROSS</div></td><td class="fielddoc"><p>a cross-shaped structuring element: </p><p class="formulaDsp">
\[E_{ij} = \begin{cases} 1 &amp; \texttt{if } {i=\texttt{anchor.y } {or } {j=\texttt{anchor.x}}} \\0 &amp; \texttt{otherwise} \end{cases}\]
</p>
 </td></tr>
<tr><td class="fieldname"><a id="ggac2db39b56866583a95a5680313c314ada33a3c67a61f349d21c507d05c53a755f"></a>MORPH_ELLIPSE <div class="python_language">Python: cv.MORPH_ELLIPSE</div></td><td class="fielddoc"><p>an elliptic structuring element, that is, a filled ellipse inscribed into the rectangle Rect(0, 0, esize.width, 0.esize.height) </p>
</td></tr>
</table>
</div>
</div>
<a id="ga7be549266bad7b2e6a04db49827f9f32"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7be549266bad7b2e6a04db49827f9f32">◆ </a></span>MorphTypes</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="../../d4/d86/group__imgproc__filter.html#ga7be549266bad7b2e6a04db49827f9f32">cv::MorphTypes</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>type of morphological operation </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga7be549266bad7b2e6a04db49827f9f32aa3783a21b429f4c31c178264a0403fcd"></a>MORPH_ERODE <div class="python_language">Python: cv.MORPH_ERODE</div></td><td class="fielddoc"><p>see <a class="el" href="../../d4/d86/group__imgproc__filter.html#gaeb1e0c1033e3f6b891a25d0511362aeb" title="Erodes an image by using a specific structuring element. ">erode</a> </p>
</td></tr>
<tr><td class="fieldname"><a id="gga7be549266bad7b2e6a04db49827f9f32a2b9f6b6fb168b4d1d5277caebfe7b73d"></a>MORPH_DILATE <div class="python_language">Python: cv.MORPH_DILATE</div></td><td class="fielddoc"><p>see <a class="el" href="../../d4/d86/group__imgproc__filter.html#ga4ff0f3318642c4f469d0e11f242f3b6c" title="Dilates an image by using a specific structuring element. ">dilate</a> </p>
</td></tr>
<tr><td class="fieldname"><a id="gga7be549266bad7b2e6a04db49827f9f32a08d3cc3a2ace00cec488966d31fa29ea"></a>MORPH_OPEN <div class="python_language">Python: cv.MORPH_OPEN</div></td><td class="fielddoc"><p>an opening operation </p><p class="formulaDsp">
\[\texttt{dst} = \mathrm{open} ( \texttt{src} , \texttt{element} )= \mathrm{dilate} ( \mathrm{erode} ( \texttt{src} , \texttt{element} ))\]
</p>
 </td></tr>
<tr><td class="fieldname"><a id="gga7be549266bad7b2e6a04db49827f9f32a68c4b9c6144a30bcd52d1cdf39bb30e1"></a>MORPH_CLOSE <div class="python_language">Python: cv.MORPH_CLOSE</div></td><td class="fielddoc"><p>a closing operation </p><p class="formulaDsp">
\[\texttt{dst} = \mathrm{close} ( \texttt{src} , \texttt{element} )= \mathrm{erode} ( \mathrm{dilate} ( \texttt{src} , \texttt{element} ))\]
</p>
 </td></tr>
<tr><td class="fieldname"><a id="gga7be549266bad7b2e6a04db49827f9f32a887efd64e82cee95a62f851c7f3b617b"></a>MORPH_GRADIENT <div class="python_language">Python: cv.MORPH_GRADIENT</div></td><td class="fielddoc"><p>a morphological gradient </p><p class="formulaDsp">
\[\texttt{dst} = \mathrm{morph\_grad} ( \texttt{src} , \texttt{element} )= \mathrm{dilate} ( \texttt{src} , \texttt{element} )- \mathrm{erode} ( \texttt{src} , \texttt{element} )\]
</p>
 </td></tr>
<tr><td class="fieldname"><a id="gga7be549266bad7b2e6a04db49827f9f32ada67be24f4dce6d7e6c57527f8724f3b"></a>MORPH_TOPHAT <div class="python_language">Python: cv.MORPH_TOPHAT</div></td><td class="fielddoc"><p>"top hat" </p><p class="formulaDsp">
\[\texttt{dst} = \mathrm{tophat} ( \texttt{src} , \texttt{element} )= \texttt{src} - \mathrm{open} ( \texttt{src} , \texttt{element} )\]
</p>
 </td></tr>
<tr><td class="fieldname"><a id="gga7be549266bad7b2e6a04db49827f9f32a24d27f56df6b98b1cb92ae8108d4638f"></a>MORPH_BLACKHAT <div class="python_language">Python: cv.MORPH_BLACKHAT</div></td><td class="fielddoc"><p>"black hat" </p><p class="formulaDsp">
\[\texttt{dst} = \mathrm{blackhat} ( \texttt{src} , \texttt{element} )= \mathrm{close} ( \texttt{src} , \texttt{element} )- \texttt{src}\]
</p>
 </td></tr>
<tr><td class="fieldname"><a id="gga7be549266bad7b2e6a04db49827f9f32acf55ff766595ec0174ba42852f0ac264"></a>MORPH_HITMISS <div class="python_language">Python: cv.MORPH_HITMISS</div></td><td class="fielddoc"><p>"hit or miss" .- Only supported for CV_8UC1 binary images. A tutorial can be found in the documentation </p>
</td></tr>
</table>
</div>
</div>
<a id="gad8e695e87dee497e227716576c244598"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad8e695e87dee497e227716576c244598">◆ </a></span>SpecialFilter</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="../../d4/d86/group__imgproc__filter.html#gad8e695e87dee497e227716576c244598">cv::SpecialFilter</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggad8e695e87dee497e227716576c244598a460c815d2bb921fb7f53f4220e19c1d5"></a>FILTER_SCHARR <div class="python_language">Python: cv.FILTER_SCHARR</div></td><td class="fielddoc"></td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga9d7064d478c95d60003cf839430737ed"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9d7064d478c95d60003cf839430737ed">◆ </a></span>bilateralFilter()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::bilateralFilter </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>d</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>sigmaColor</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>sigmaSpace</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>borderType</em> = <code><a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a></code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.bilateralFilter(</td><td class="paramname">src, d, sigmaColor, sigmaSpace[, dst[, borderType]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Applies the bilateral filter to an image. </p>
<p>The function applies bilateral filtering to the input image, as described in <a href="http://www.dai.ed.ac.uk/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html">http://www.dai.ed.ac.uk/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html</a> bilateralFilter can reduce unwanted noise very well while keeping edges fairly sharp. However, it is very slow compared to most filters.</p>
<p><em>Sigma values</em>: For simplicity, you can set the 2 sigma values to be the same. If they are small (&lt; 10), the filter will not have much effect, whereas if they are large (&gt; 150), they will have a very strong effect, making the image look "cartoonish".</p>
<p><em>Filter size</em>: Large filters (d &gt; 5) are very slow, so it is recommended to use d=5 for real-time applications, and perhaps d=9 for offline applications that need heavy noise filtering.</p>
<p>This filter does not work inplace. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>Source 8-bit or floating-point, 1-channel or 3-channel image. </td></tr>
    <tr><td class="paramname">dst</td><td>Destination image of the same size and type as src . </td></tr>
    <tr><td class="paramname">d</td><td>Diameter of each pixel neighborhood that is used during filtering. If it is non-positive, it is computed from sigmaSpace. </td></tr>
    <tr><td class="paramname">sigmaColor</td><td>Filter sigma in the color space. A larger value of the parameter means that farther colors within the pixel neighborhood (see sigmaSpace) will be mixed together, resulting in larger areas of semi-equal color. </td></tr>
    <tr><td class="paramname">sigmaSpace</td><td>Filter sigma in the coordinate space. A larger value of the parameter means that farther pixels will influence each other as long as their colors are close enough (see sigmaColor ). When d&gt;0, it specifies the neighborhood size regardless of sigmaSpace. Otherwise, d is proportional to sigmaSpace. </td></tr>
    <tr><td class="paramname">borderType</td><td>border mode used to extrapolate pixels outside of the image, see <a class="el" href="../../d2/de8/group__core__array.html#ga209f2f4869e304c82d07739337eae7c5">BorderTypes</a> </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d3/d8f/samples_2cpp_2tutorial_code_2ImgProc_2Smoothing_2Smoothing_8cpp-example.html#a13">samples/cpp/tutorial_code/ImgProc/Smoothing/Smoothing.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="ga8c45db9afe636703801b0b2e440fce37"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8c45db9afe636703801b0b2e440fce37">◆ </a></span>blur()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::blur </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> </td>
          <td class="paramname"><em>ksize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> </td>
          <td class="paramname"><em>anchor</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>(-1,-1)</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>borderType</em> = <code><a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a></code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.blur(</td><td class="paramname">src, ksize[, dst[, anchor[, borderType]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Blurs an image using the normalized box filter. </p>
<p>The function smooths an image using the kernel:</p>
<p class="formulaDsp">
\[\texttt{K} = \frac{1}{\texttt{ksize.width*ksize.height}} \begin{bmatrix} 1 &amp; 1 &amp; 1 &amp; \cdots &amp; 1 &amp; 1 \\ 1 &amp; 1 &amp; 1 &amp; \cdots &amp; 1 &amp; 1 \\ \hdotsfor{6} \\ 1 &amp; 1 &amp; 1 &amp; \cdots &amp; 1 &amp; 1 \\ \end{bmatrix}\]
</p>
<p>The call <code>blur(src, dst, ksize, anchor, borderType)</code> is equivalent to <code>boxFilter(src, dst, src.type(), ksize, anchor, true, borderType)</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>input image; it can have any number of channels, which are processed independently, but the depth should be CV_8U, CV_16U, CV_16S, CV_32F or CV_64F. </td></tr>
    <tr><td class="paramname">dst</td><td>output image of the same size and type as src. </td></tr>
    <tr><td class="paramname">ksize</td><td>blurring kernel size. </td></tr>
    <tr><td class="paramname">anchor</td><td>anchor point; default value Point(-1,-1) means that the anchor is at the kernel center. </td></tr>
    <tr><td class="paramname">borderType</td><td>border mode used to extrapolate pixels outside of the image, see <a class="el" href="../../d2/de8/group__core__array.html#ga209f2f4869e304c82d07739337eae7c5">BorderTypes</a>. <a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5a697c1b011884a7c2bdc0e5caf7955661" title="cdefgh|abcdefgh|abcdefg ">BORDER_WRAP</a> is not supported. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d4/d86/group__imgproc__filter.html#gad533230ebf2d42509547d514f7d3fbc3" title="Blurs an image using the box filter. ">boxFilter</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#ga9d7064d478c95d60003cf839430737ed" title="Applies the bilateral filter to an image. ">bilateralFilter</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#gaabe8c836e97159a9193fb0b11ac52cf1" title="Blurs an image using a Gaussian filter. ">GaussianBlur</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#ga564869aa33e58769b4469101aac458f9" title="Blurs an image using the median filter. ">medianBlur</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d6/d56/samples_2cpp_2edge_8cpp-example.html#a1">samples/cpp/edge.cpp</a>, <a class="el" href="../../d6/ddf/samples_2cpp_2laplace_8cpp-example.html#a21">samples/cpp/laplace.cpp</a>, and <a class="el" href="../../d3/d8f/samples_2cpp_2tutorial_code_2ImgProc_2Smoothing_2Smoothing_8cpp-example.html#a8">samples/cpp/tutorial_code/ImgProc/Smoothing/Smoothing.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="gad533230ebf2d42509547d514f7d3fbc3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad533230ebf2d42509547d514f7d3fbc3">◆ </a></span>boxFilter()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::boxFilter </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>ddepth</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> </td>
          <td class="paramname"><em>ksize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> </td>
          <td class="paramname"><em>anchor</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>(-1,-1)</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool </td>
          <td class="paramname"><em>normalize</em> = <code>true</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>borderType</em> = <code><a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a></code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.boxFilter(</td><td class="paramname">src, ddepth, ksize[, dst[, anchor[, normalize[, borderType]]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Blurs an image using the box filter. </p>
<p>The function smooths an image using the kernel:</p>
<p class="formulaDsp">
\[\texttt{K} = \alpha \begin{bmatrix} 1 &amp; 1 &amp; 1 &amp; \cdots &amp; 1 &amp; 1 \\ 1 &amp; 1 &amp; 1 &amp; \cdots &amp; 1 &amp; 1 \\ \hdotsfor{6} \\ 1 &amp; 1 &amp; 1 &amp; \cdots &amp; 1 &amp; 1 \end{bmatrix}\]
</p>
<p>where</p>
<p class="formulaDsp">
\[\alpha = \begin{cases} \frac{1}{\texttt{ksize.width*ksize.height}} &amp; \texttt{when } \texttt{normalize=true} \\1 &amp; \texttt{otherwise}\end{cases}\]
</p>
<p>Unnormalized box filter is useful for computing various integral characteristics over each pixel neighborhood, such as covariance matrices of image derivatives (used in dense optical flow algorithms, and so on). If you need to compute pixel sums over variable-size windows, use <a class="el" href="../../d7/d1b/group__imgproc__misc.html#gadeaf38d7701d7ad371278d663c50c77d">integral</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>input image. </td></tr>
    <tr><td class="paramname">dst</td><td>output image of the same size and type as src. </td></tr>
    <tr><td class="paramname">ddepth</td><td>the output image depth (-1 to use <a class="el" href="../../d0/daf/group__projection.html#ga8b5e5413af41caf3f2a0bbf4cdf517a8" title="Returns the depth of a point transformed by a rigid transform. ">src.depth()</a>). </td></tr>
    <tr><td class="paramname">ksize</td><td>blurring kernel size. </td></tr>
    <tr><td class="paramname">anchor</td><td>anchor point; default value Point(-1,-1) means that the anchor is at the kernel center. </td></tr>
    <tr><td class="paramname">normalize</td><td>flag, specifying whether the kernel is normalized by its area or not. </td></tr>
    <tr><td class="paramname">borderType</td><td>border mode used to extrapolate pixels outside of the image, see <a class="el" href="../../d2/de8/group__core__array.html#ga209f2f4869e304c82d07739337eae7c5">BorderTypes</a>. <a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5a697c1b011884a7c2bdc0e5caf7955661" title="cdefgh|abcdefgh|abcdefg ">BORDER_WRAP</a> is not supported. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d4/d86/group__imgproc__filter.html#ga8c45db9afe636703801b0b2e440fce37" title="Blurs an image using the normalized box filter. ">blur</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#ga9d7064d478c95d60003cf839430737ed" title="Applies the bilateral filter to an image. ">bilateralFilter</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#gaabe8c836e97159a9193fb0b11ac52cf1" title="Blurs an image using a Gaussian filter. ">GaussianBlur</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#ga564869aa33e58769b4469101aac458f9" title="Blurs an image using the median filter. ">medianBlur</a>, <a class="el" href="../../d7/d1b/group__imgproc__misc.html#gadeaf38d7701d7ad371278d663c50c77d">integral</a> </dd></dl>
</div>
</div>
<a id="gacfdda2bc1ac55e96de7e9f0bce7238c0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacfdda2bc1ac55e96de7e9f0bce7238c0">◆ </a></span>buildPyramid()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::buildPyramid </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga889a09549b98223016170d9b613715de">OutputArrayOfArrays</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>maxlevel</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>borderType</em> = <code><a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a></code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Constructs the Gaussian pyramid for an image. </p>
<p>The function constructs a vector of images and builds the Gaussian pyramid by recursively applying pyrDown to the previously built pyramid layers, starting from <code>dst[0]==src</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>Source image. Check pyrDown for the list of supported types. </td></tr>
    <tr><td class="paramname">dst</td><td>Destination vector of maxlevel+1 images of the same type as src. dst[0] will be the same as src. dst[1] is the next pyramid layer, a smoothed and down-sized src, and so on. </td></tr>
    <tr><td class="paramname">maxlevel</td><td>0-based index of the last (the smallest) pyramid layer. It must be non-negative. </td></tr>
    <tr><td class="paramname">borderType</td><td>Pixel extrapolation method, see <a class="el" href="../../d2/de8/group__core__array.html#ga209f2f4869e304c82d07739337eae7c5">BorderTypes</a> (<a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5aed2e4346047e265c8c5a6d0276dcd838" title="iiiiii|abcdefgh|iiiiiii with some specified i ">BORDER_CONSTANT</a> isn't supported) </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<a id="ga4ff0f3318642c4f469d0e11f242f3b6c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4ff0f3318642c4f469d0e11f242f3b6c">◆ </a></span>dilate()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::dilate </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>kernel</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> </td>
          <td class="paramname"><em>anchor</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>(-1,-1)</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>iterations</em> = <code>1</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>borderType</em> = <code><a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5aed2e4346047e265c8c5a6d0276dcd838">BORDER_CONSTANT</a></code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a> &amp; </td>
          <td class="paramname"><em>borderValue</em> = <code><a class="el" href="../../d4/d86/group__imgproc__filter.html#ga94756fad83d9d24d29c9bf478558c40a">morphologyDefaultBorderValue</a>()</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.dilate(</td><td class="paramname">src, kernel[, dst[, anchor[, iterations[, borderType[, borderValue]]]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Dilates an image by using a specific structuring element. </p>
<p>The function dilates the source image using the specified structuring element that determines the shape of a pixel neighborhood over which the maximum is taken: </p><p class="formulaDsp">
\[\texttt{dst} (x,y) = \max _{(x',y'): \, \texttt{element} (x',y') \ne0 } \texttt{src} (x+x',y+y')\]
</p>
<p>The function supports the in-place mode. Dilation can be applied several ( iterations ) times. In case of multi-channel images, each channel is processed independently.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>input image; the number of channels can be arbitrary, but the depth should be one of CV_8U, CV_16U, CV_16S, CV_32F or CV_64F. </td></tr>
    <tr><td class="paramname">dst</td><td>output image of the same size and type as src. </td></tr>
    <tr><td class="paramname">kernel</td><td>structuring element used for dilation; if elemenat=Mat(), a 3 x 3 rectangular structuring element is used. Kernel can be created using <a class="el" href="../../d4/d86/group__imgproc__filter.html#gac342a1bb6eabf6f55c803b09268e36dc" title="Returns a structuring element of the specified size and shape for morphological operations. ">getStructuringElement</a> </td></tr>
    <tr><td class="paramname">anchor</td><td>position of the anchor within the element; default value (-1, -1) means that the anchor is at the element center. </td></tr>
    <tr><td class="paramname">iterations</td><td>number of times dilation is applied. </td></tr>
    <tr><td class="paramname">borderType</td><td>pixel extrapolation method, see <a class="el" href="../../d2/de8/group__core__array.html#ga209f2f4869e304c82d07739337eae7c5">BorderTypes</a>. <a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5a697c1b011884a7c2bdc0e5caf7955661" title="cdefgh|abcdefgh|abcdefg ">BORDER_WRAP</a> is not suported. </td></tr>
    <tr><td class="paramname">borderValue</td><td>border value in case of a constant border </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d4/d86/group__imgproc__filter.html#gaeb1e0c1033e3f6b891a25d0511362aeb" title="Erodes an image by using a specific structuring element. ">erode</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#ga67493776e3ad1a3df63883829375201f" title="Performs advanced morphological transformations. ">morphologyEx</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#gac342a1bb6eabf6f55c803b09268e36dc" title="Returns a structuring element of the specified size and shape for morphological operations. ">getStructuringElement</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d5/de8/samples_2cpp_2segment_objects_8cpp-example.html#a2">samples/cpp/segment_objects.cpp</a>, <a class="el" href="../../db/d00/samples_2cpp_2squares_8cpp-example.html#a15">samples/cpp/squares.cpp</a>, <a class="el" href="../../d9/dd8/samples_2cpp_2stitching_detailed_8cpp-example.html#a54">samples/cpp/stitching_detailed.cpp</a>, <a class="el" href="../../df/d5e/samples_2cpp_2tutorial_code_2ImgProc_2Morphology_1_8cpp-example.html#a20">samples/cpp/tutorial_code/ImgProc/Morphology_1.cpp</a>, and <a class="el" href="../../de/dc0/samples_2tapi_2squares_8cpp-example.html#a14">samples/tapi/squares.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="gaeb1e0c1033e3f6b891a25d0511362aeb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaeb1e0c1033e3f6b891a25d0511362aeb">◆ </a></span>erode()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::erode </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>kernel</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> </td>
          <td class="paramname"><em>anchor</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>(-1,-1)</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>iterations</em> = <code>1</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>borderType</em> = <code><a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5aed2e4346047e265c8c5a6d0276dcd838">BORDER_CONSTANT</a></code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a> &amp; </td>
          <td class="paramname"><em>borderValue</em> = <code><a class="el" href="../../d4/d86/group__imgproc__filter.html#ga94756fad83d9d24d29c9bf478558c40a">morphologyDefaultBorderValue</a>()</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.erode(</td><td class="paramname">src, kernel[, dst[, anchor[, iterations[, borderType[, borderValue]]]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Erodes an image by using a specific structuring element. </p>
<p>The function erodes the source image using the specified structuring element that determines the shape of a pixel neighborhood over which the minimum is taken:</p>
<p class="formulaDsp">
\[\texttt{dst} (x,y) = \min _{(x',y'): \, \texttt{element} (x',y') \ne0 } \texttt{src} (x+x',y+y')\]
</p>
<p>The function supports the in-place mode. Erosion can be applied several ( iterations ) times. In case of multi-channel images, each channel is processed independently.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>input image; the number of channels can be arbitrary, but the depth should be one of CV_8U, CV_16U, CV_16S, CV_32F or CV_64F. </td></tr>
    <tr><td class="paramname">dst</td><td>output image of the same size and type as src. </td></tr>
    <tr><td class="paramname">kernel</td><td>structuring element used for erosion; if <code>element=Mat()</code>, a <code>3 x 3</code> rectangular structuring element is used. Kernel can be created using <a class="el" href="../../d4/d86/group__imgproc__filter.html#gac342a1bb6eabf6f55c803b09268e36dc" title="Returns a structuring element of the specified size and shape for morphological operations. ">getStructuringElement</a>. </td></tr>
    <tr><td class="paramname">anchor</td><td>position of the anchor within the element; default value (-1, -1) means that the anchor is at the element center. </td></tr>
    <tr><td class="paramname">iterations</td><td>number of times erosion is applied. </td></tr>
    <tr><td class="paramname">borderType</td><td>pixel extrapolation method, see <a class="el" href="../../d2/de8/group__core__array.html#ga209f2f4869e304c82d07739337eae7c5">BorderTypes</a>. <a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5a697c1b011884a7c2bdc0e5caf7955661" title="cdefgh|abcdefgh|abcdefg ">BORDER_WRAP</a> is not supported. </td></tr>
    <tr><td class="paramname">borderValue</td><td>border value in case of a constant border </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d4/d86/group__imgproc__filter.html#ga4ff0f3318642c4f469d0e11f242f3b6c" title="Dilates an image by using a specific structuring element. ">dilate</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#ga67493776e3ad1a3df63883829375201f" title="Performs advanced morphological transformations. ">morphologyEx</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#gac342a1bb6eabf6f55c803b09268e36dc" title="Returns a structuring element of the specified size and shape for morphological operations. ">getStructuringElement</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d5/de8/samples_2cpp_2segment_objects_8cpp-example.html#a4">samples/cpp/segment_objects.cpp</a>, and <a class="el" href="../../df/d5e/samples_2cpp_2tutorial_code_2ImgProc_2Morphology_1_8cpp-example.html#a18">samples/cpp/tutorial_code/ImgProc/Morphology_1.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="ga27c049795ce870216ddfb366086b5a04"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga27c049795ce870216ddfb366086b5a04">◆ </a></span>filter2D()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::filter2D </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>ddepth</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>kernel</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> </td>
          <td class="paramname"><em>anchor</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>(-1,-1)</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>delta</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>borderType</em> = <code><a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a></code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.filter2D(</td><td class="paramname">src, ddepth, kernel[, dst[, anchor[, delta[, borderType]]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Convolves an image with the kernel. </p>
<p>The function applies an arbitrary linear filter to an image. In-place operation is supported. When the aperture is partially outside the image, the function interpolates outlier pixel values according to the specified border mode.</p>
<p>The function does actually compute correlation, not the convolution:</p>
<p class="formulaDsp">
\[\texttt{dst} (x,y) = \sum _{ \substack{0\leq x' &lt; \texttt{kernel.cols}\\{0\leq y' &lt; \texttt{kernel.rows}}}} \texttt{kernel} (x',y')* \texttt{src} (x+x'- \texttt{anchor.x} ,y+y'- \texttt{anchor.y} )\]
</p>
<p>That is, the kernel is not mirrored around the anchor point. If you need a real convolution, flip the kernel using <a class="el" href="../../d2/de8/group__core__array.html#gaca7be533e3dac7feb70fc60635adf441" title="Flips a 2D array around vertical, horizontal, or both axes. ">flip</a> and set the new anchor to <code>(kernel.cols - anchor.x - 1, kernel.rows - anchor.y - 1)</code>.</p>
<p>The function uses the DFT-based algorithm in case of sufficiently large kernels (~<code>11 x 11</code> or larger) and the direct algorithm for small kernels.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>input image. </td></tr>
    <tr><td class="paramname">dst</td><td>output image of the same size and the same number of channels as src. </td></tr>
    <tr><td class="paramname">ddepth</td><td>desired depth of the destination image, see <a class="el" href="../../d4/d86/group__imgproc__filter.html#filter_depths">combinations</a> </td></tr>
    <tr><td class="paramname">kernel</td><td>convolution kernel (or rather a correlation kernel), a single-channel floating point matrix; if you want to apply different kernels to different channels, split the image into separate color planes using split and process them individually. </td></tr>
    <tr><td class="paramname">anchor</td><td>anchor of the kernel that indicates the relative position of a filtered point within the kernel; the anchor should lie within the kernel; default value (-1,-1) means that the anchor is at the kernel center. </td></tr>
    <tr><td class="paramname">delta</td><td>optional value added to the filtered pixels before storing them in dst. </td></tr>
    <tr><td class="paramname">borderType</td><td>pixel extrapolation method, see <a class="el" href="../../d2/de8/group__core__array.html#ga209f2f4869e304c82d07739337eae7c5">BorderTypes</a>. <a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5a697c1b011884a7c2bdc0e5caf7955661" title="cdefgh|abcdefgh|abcdefg ">BORDER_WRAP</a> is not supported. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d4/d86/group__imgproc__filter.html#ga910e29ff7d7b105057d1625a4bf6318d" title="Applies a separable linear filter to an image. ">sepFilter2D</a>, <a class="el" href="../../d2/de8/group__core__array.html#gadd6cf9baf2b8b704a11b5f04aaf4f39d" title="Performs a forward or inverse Discrete Fourier transform of a 1D or 2D floating-point array...">dft</a>, <a class="el" href="../../df/dfb/group__imgproc__object.html#ga586ebfb0a7fb604b35a23d85391329be" title="Compares a template against overlapped image regions. ">matchTemplate</a> </dd></dl>
</div>
</div>
<a id="gaabe8c836e97159a9193fb0b11ac52cf1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaabe8c836e97159a9193fb0b11ac52cf1">◆ </a></span>GaussianBlur()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::GaussianBlur </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> </td>
          <td class="paramname"><em>ksize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>sigmaX</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>sigmaY</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>borderType</em> = <code><a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a></code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.GaussianBlur(</td><td class="paramname">src, ksize, sigmaX[, dst[, sigmaY[, borderType]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Blurs an image using a Gaussian filter. </p>
<p>The function convolves the source image with the specified Gaussian kernel. In-place filtering is supported.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>input image; the image can have any number of channels, which are processed independently, but the depth should be CV_8U, CV_16U, CV_16S, CV_32F or CV_64F. </td></tr>
    <tr><td class="paramname">dst</td><td>output image of the same size and type as src. </td></tr>
    <tr><td class="paramname">ksize</td><td>Gaussian kernel size. ksize.width and ksize.height can differ but they both must be positive and odd. Or, they can be zero's and then they are computed from sigma. </td></tr>
    <tr><td class="paramname">sigmaX</td><td>Gaussian kernel standard deviation in X direction. </td></tr>
    <tr><td class="paramname">sigmaY</td><td>Gaussian kernel standard deviation in Y direction; if sigmaY is zero, it is set to be equal to sigmaX, if both sigmas are zeros, they are computed from ksize.width and ksize.height, respectively (see <a class="el" href="../../d4/d86/group__imgproc__filter.html#gac05a120c1ae92a6060dd0db190a61afa" title="Returns Gaussian filter coefficients. ">getGaussianKernel</a> for details); to fully control the result regardless of possible future modifications of all this semantics, it is recommended to specify all of ksize, sigmaX, and sigmaY. </td></tr>
    <tr><td class="paramname">borderType</td><td>pixel extrapolation method, see <a class="el" href="../../d2/de8/group__core__array.html#ga209f2f4869e304c82d07739337eae7c5">BorderTypes</a>. <a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5a697c1b011884a7c2bdc0e5caf7955661" title="cdefgh|abcdefgh|abcdefg ">BORDER_WRAP</a> is not supported.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d4/d86/group__imgproc__filter.html#ga910e29ff7d7b105057d1625a4bf6318d" title="Applies a separable linear filter to an image. ">sepFilter2D</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#ga27c049795ce870216ddfb366086b5a04" title="Convolves an image with the kernel. ">filter2D</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#ga8c45db9afe636703801b0b2e440fce37" title="Blurs an image using the normalized box filter. ">blur</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#gad533230ebf2d42509547d514f7d3fbc3" title="Blurs an image using the box filter. ">boxFilter</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#ga9d7064d478c95d60003cf839430737ed" title="Applies the bilateral filter to an image. ">bilateralFilter</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#ga564869aa33e58769b4469101aac458f9" title="Blurs an image using the median filter. ">medianBlur</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d6/ddf/samples_2cpp_2laplace_8cpp-example.html#a19">samples/cpp/laplace.cpp</a>, <a class="el" href="../../d3/d8f/samples_2cpp_2tutorial_code_2ImgProc_2Smoothing_2Smoothing_8cpp-example.html#a11">samples/cpp/tutorial_code/ImgProc/Smoothing/Smoothing.cpp</a>, and <a class="el" href="../../d3/d94/samples_2cpp_2tutorial_code_2ImgTrans_2Sobel_Demo_8cpp-example.html#a9">samples/cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="ga6d6c23f7bd3f5836c31cfae994fc4aea"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6d6c23f7bd3f5836c31cfae994fc4aea">◆ </a></span>getDerivKernels()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::getDerivKernels </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>kx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>ky</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>dx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>dy</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>ksize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool </td>
          <td class="paramname"><em>normalize</em> = <code>false</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>ktype</em> = <code><a class="el" href="../../d1/d1b/group__core__hal__interface.html#ga4a3def5d72b74bed31f5f8ab7676099c">CV_32F</a></code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>kx, ky</td><td>=</td><td>cv.getDerivKernels(</td><td class="paramname">dx, dy, ksize[, kx[, ky[, normalize[, ktype]]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Returns filter coefficients for computing spatial image derivatives. </p>
<p>The function computes and returns the filter coefficients for spatial image derivatives. When <code>ksize=FILTER_SCHARR</code>, the Scharr \(3 \times 3\) kernels are generated (see <a class="el" href="../../d4/d86/group__imgproc__filter.html#gaa13106761eedf14798f37aa2d60404c9" title="Calculates the first x- or y- image derivative using Scharr operator. ">Scharr</a>). Otherwise, Sobel kernels are generated (see <a class="el" href="../../d4/d86/group__imgproc__filter.html#gacea54f142e81b6758cb6f375ce782c8d" title="Calculates the first, second, third, or mixed image derivatives using an extended Sobel operator...">Sobel</a>). The filters are normally passed to <a class="el" href="../../d4/d86/group__imgproc__filter.html#ga910e29ff7d7b105057d1625a4bf6318d" title="Applies a separable linear filter to an image. ">sepFilter2D</a> or to</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">kx</td><td>Output matrix of row filter coefficients. It has the type ktype . </td></tr>
    <tr><td class="paramname">ky</td><td>Output matrix of column filter coefficients. It has the type ktype . </td></tr>
    <tr><td class="paramname">dx</td><td>Derivative order in respect of x. </td></tr>
    <tr><td class="paramname">dy</td><td>Derivative order in respect of y. </td></tr>
    <tr><td class="paramname">ksize</td><td>Aperture size. It can be FILTER_SCHARR, 1, 3, 5, or 7. </td></tr>
    <tr><td class="paramname">normalize</td><td>Flag indicating whether to normalize (scale down) the filter coefficients or not. Theoretically, the coefficients should have the denominator \(=2^{ksize*2-dx-dy-2}\). If you are going to filter floating-point images, you are likely to use the normalized kernels. But if you compute derivatives of an 8-bit image, store the results in a 16-bit image, and wish to preserve all the fractional bits, you may want to set normalize=false . </td></tr>
    <tr><td class="paramname">ktype</td><td>Type of filter coefficients. It can be CV_32f or CV_64F . </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<a id="gae84c92d248183bd92fa713ce51cc3599"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae84c92d248183bd92fa713ce51cc3599">◆ </a></span>getGaborKernel()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::getGaborKernel </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> </td>
          <td class="paramname"><em>ksize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>sigma</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>theta</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>lambd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>gamma</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>psi</em> = <code><a class="el" href="../../db/de0/group__core__utils.html#ga677b89fae9308b340ddaebf0dba8455f">CV_PI</a> *0.5</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>ktype</em> = <code><a class="el" href="../../d1/d1b/group__core__hal__interface.html#ga30a562691cc5987bc88eb7bb7a8faf2b">CV_64F</a></code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.getGaborKernel(</td><td class="paramname">ksize, sigma, theta, lambd, gamma[, psi[, ktype]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Returns Gabor filter coefficients. </p>
<p>For more details about gabor filter equations and parameters, see: <a href="http://en.wikipedia.org/wiki/Gabor_filter">Gabor Filter</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ksize</td><td>Size of the filter returned. </td></tr>
    <tr><td class="paramname">sigma</td><td>Standard deviation of the gaussian envelope. </td></tr>
    <tr><td class="paramname">theta</td><td>Orientation of the normal to the parallel stripes of a Gabor function. </td></tr>
    <tr><td class="paramname">lambd</td><td>Wavelength of the sinusoidal factor. </td></tr>
    <tr><td class="paramname">gamma</td><td>Spatial aspect ratio. </td></tr>
    <tr><td class="paramname">psi</td><td>Phase offset. </td></tr>
    <tr><td class="paramname">ktype</td><td>Type of filter coefficients. It can be CV_32F or CV_64F . </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<a id="gac05a120c1ae92a6060dd0db190a61afa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac05a120c1ae92a6060dd0db190a61afa">◆ </a></span>getGaussianKernel()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::getGaussianKernel </td>
          <td>(</td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>ksize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>sigma</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>ktype</em> = <code><a class="el" href="../../d1/d1b/group__core__hal__interface.html#ga30a562691cc5987bc88eb7bb7a8faf2b">CV_64F</a></code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.getGaussianKernel(</td><td class="paramname">ksize, sigma[, ktype]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Returns Gaussian filter coefficients. </p>
<p>The function computes and returns the \(\texttt{ksize} \times 1\) matrix of Gaussian filter coefficients:</p>
<p class="formulaDsp">
\[G_i= \alpha *e^{-(i-( \texttt{ksize} -1)/2)^2/(2* \texttt{sigma}^2)},\]
</p>
<p>where \(i=0..\texttt{ksize}-1\) and \(\alpha\) is the scale factor chosen so that \(\sum_i G_i=1\).</p>
<p>Two of such generated kernels can be passed to sepFilter2D. Those functions automatically recognize smoothing kernels (a symmetrical kernel with sum of weights equal to 1) and handle them accordingly. You may also use the higher-level GaussianBlur. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ksize</td><td>Aperture size. It should be odd ( \(\texttt{ksize} \mod 2 = 1\) ) and positive. </td></tr>
    <tr><td class="paramname">sigma</td><td>Gaussian standard deviation. If it is non-positive, it is computed from ksize as <code>sigma = 0.3*((ksize-1)*0.5 - 1) + 0.8</code>. </td></tr>
    <tr><td class="paramname">ktype</td><td>Type of filter coefficients. It can be CV_32F or CV_64F . </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d4/d86/group__imgproc__filter.html#ga910e29ff7d7b105057d1625a4bf6318d" title="Applies a separable linear filter to an image. ">sepFilter2D</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#ga6d6c23f7bd3f5836c31cfae994fc4aea" title="Returns filter coefficients for computing spatial image derivatives. ">getDerivKernels</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#gac342a1bb6eabf6f55c803b09268e36dc" title="Returns a structuring element of the specified size and shape for morphological operations. ">getStructuringElement</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#gaabe8c836e97159a9193fb0b11ac52cf1" title="Blurs an image using a Gaussian filter. ">GaussianBlur</a> </dd></dl>
</div>
</div>
<a id="gac342a1bb6eabf6f55c803b09268e36dc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac342a1bb6eabf6f55c803b09268e36dc">◆ </a></span>getStructuringElement()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> cv::getStructuringElement </td>
          <td>(</td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>shape</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> </td>
          <td class="paramname"><em>ksize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> </td>
          <td class="paramname"><em>anchor</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>(-1,-1)</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.getStructuringElement(</td><td class="paramname">shape, ksize[, anchor]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Returns a structuring element of the specified size and shape for morphological operations. </p>
<p>The function constructs and returns the structuring element that can be further passed to <a class="el" href="../../d4/d86/group__imgproc__filter.html#gaeb1e0c1033e3f6b891a25d0511362aeb" title="Erodes an image by using a specific structuring element. ">erode</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#ga4ff0f3318642c4f469d0e11f242f3b6c" title="Dilates an image by using a specific structuring element. ">dilate</a> or <a class="el" href="../../d4/d86/group__imgproc__filter.html#ga67493776e3ad1a3df63883829375201f" title="Performs advanced morphological transformations. ">morphologyEx</a>. But you can also construct an arbitrary binary mask yourself and use it as the structuring element.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">shape</td><td>Element shape that could be one of <a class="el" href="../../d4/d86/group__imgproc__filter.html#gac2db39b56866583a95a5680313c314ad" title="shape of the structuring element ">MorphShapes</a> </td></tr>
    <tr><td class="paramname">ksize</td><td>Size of the structuring element. </td></tr>
    <tr><td class="paramname">anchor</td><td>Anchor position within the element. The default value \((-1, -1)\) means that the anchor is at the center. Note that only the shape of a cross-shaped element depends on the anchor position. In other cases the anchor just regulates how much the result of the morphological operation is shifted. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../df/d5e/samples_2cpp_2tutorial_code_2ImgProc_2Morphology_1_8cpp-example.html#a15">samples/cpp/tutorial_code/ImgProc/Morphology_1.cpp</a>, and <a class="el" href="../../da/d34/samples_2cpp_2tutorial_code_2ImgProc_2Morphology_2_8cpp-example.html#a10">samples/cpp/tutorial_code/ImgProc/Morphology_2.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="gad78703e4c8fe703d479c1860d76429e6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad78703e4c8fe703d479c1860d76429e6">◆ </a></span>Laplacian()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::Laplacian </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>ddepth</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>ksize</em> = <code>1</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>scale</em> = <code>1</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>delta</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>borderType</em> = <code><a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a></code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.Laplacian(</td><td class="paramname">src, ddepth[, dst[, ksize[, scale[, delta[, borderType]]]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Calculates the Laplacian of an image. </p>
<p>The function calculates the Laplacian of the source image by adding up the second x and y derivatives calculated using the Sobel operator:</p>
<p class="formulaDsp">
\[\texttt{dst} = \Delta \texttt{src} = \frac{\partial^2 \texttt{src}}{\partial x^2} + \frac{\partial^2 \texttt{src}}{\partial y^2}\]
</p>
<p>This is done when <code>ksize &gt; 1</code>. When <code>ksize == 1</code>, the Laplacian is computed by filtering the image with the following \(3 \times 3\) aperture:</p>
<p class="formulaDsp">
\[\vecthreethree {0}{1}{0}{1}{-4}{1}{0}{1}{0}\]
</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>Source image. </td></tr>
    <tr><td class="paramname">dst</td><td>Destination image of the same size and the same number of channels as src . </td></tr>
    <tr><td class="paramname">ddepth</td><td>Desired depth of the destination image. </td></tr>
    <tr><td class="paramname">ksize</td><td>Aperture size used to compute the second-derivative filters. See <a class="el" href="../../d4/d86/group__imgproc__filter.html#ga6d6c23f7bd3f5836c31cfae994fc4aea" title="Returns filter coefficients for computing spatial image derivatives. ">getDerivKernels</a> for details. The size must be positive and odd. </td></tr>
    <tr><td class="paramname">scale</td><td>Optional scale factor for the computed Laplacian values. By default, no scaling is applied. See <a class="el" href="../../d4/d86/group__imgproc__filter.html#ga6d6c23f7bd3f5836c31cfae994fc4aea" title="Returns filter coefficients for computing spatial image derivatives. ">getDerivKernels</a> for details. </td></tr>
    <tr><td class="paramname">delta</td><td>Optional delta value that is added to the results prior to storing them in dst . </td></tr>
    <tr><td class="paramname">borderType</td><td>Pixel extrapolation method, see <a class="el" href="../../d2/de8/group__core__array.html#ga209f2f4869e304c82d07739337eae7c5">BorderTypes</a>. <a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5a697c1b011884a7c2bdc0e5caf7955661" title="cdefgh|abcdefgh|abcdefg ">BORDER_WRAP</a> is not supported. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d4/d86/group__imgproc__filter.html#gacea54f142e81b6758cb6f375ce782c8d" title="Calculates the first, second, third, or mixed image derivatives using an extended Sobel operator...">Sobel</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#gaa13106761eedf14798f37aa2d60404c9" title="Calculates the first x- or y- image derivative using Scharr operator. ">Scharr</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d6/ddf/samples_2cpp_2laplace_8cpp-example.html#a23">samples/cpp/laplace.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="ga564869aa33e58769b4469101aac458f9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga564869aa33e58769b4469101aac458f9">◆ </a></span>medianBlur()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::medianBlur </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>ksize</em> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.medianBlur(</td><td class="paramname">src, ksize[, dst]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Blurs an image using the median filter. </p>
<p>The function smoothes an image using the median filter with the \(\texttt{ksize} \times \texttt{ksize}\) aperture. Each channel of a multi-channel image is processed independently. In-place operation is supported.</p>
<dl class="section note"><dt>Note</dt><dd>The median filter uses <a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5aa1de4cff95e3377d6d0cbe7569bd4e9f" title="aaaaaa|abcdefgh|hhhhhhh ">BORDER_REPLICATE</a> internally to cope with border pixels, see <a class="el" href="../../d2/de8/group__core__array.html#ga209f2f4869e304c82d07739337eae7c5">BorderTypes</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>input 1-, 3-, or 4-channel image; when ksize is 3 or 5, the image depth should be CV_8U, CV_16U, or CV_32F, for larger aperture sizes, it can only be CV_8U. </td></tr>
    <tr><td class="paramname">dst</td><td>destination array of the same size and type as src. </td></tr>
    <tr><td class="paramname">ksize</td><td>aperture linear size; it must be odd and greater than 1, for example: 3, 5, 7 ... </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d4/d86/group__imgproc__filter.html#ga9d7064d478c95d60003cf839430737ed" title="Applies the bilateral filter to an image. ">bilateralFilter</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#ga8c45db9afe636703801b0b2e440fce37" title="Blurs an image using the normalized box filter. ">blur</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#gad533230ebf2d42509547d514f7d3fbc3" title="Blurs an image using the box filter. ">boxFilter</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#gaabe8c836e97159a9193fb0b11ac52cf1" title="Blurs an image using a Gaussian filter. ">GaussianBlur</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d6/ddf/samples_2cpp_2laplace_8cpp-example.html#a22">samples/cpp/laplace.cpp</a>, <a class="el" href="../../d3/d8f/samples_2cpp_2tutorial_code_2ImgProc_2Smoothing_2Smoothing_8cpp-example.html#a12">samples/cpp/tutorial_code/ImgProc/Smoothing/Smoothing.cpp</a>, and <a class="el" href="../../d1/de6/samples_2cpp_2tutorial_code_2ImgTrans_2houghcircles_8cpp-example.html#a7">samples/cpp/tutorial_code/ImgTrans/houghcircles.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="ga94756fad83d9d24d29c9bf478558c40a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga94756fad83d9d24d29c9bf478558c40a">◆ </a></span>morphologyDefaultBorderValue()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a> cv::morphologyDefaultBorderValue </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>returns "magic" border value for erosion and dilation. It is automatically transformed to <a class="el" href="../../d1/da0/classcv_1_1Scalar__.html#ac1509a4b8454fe7fe29db069e13a2e6f" title="returns a scalar with all elements set to v0 ">Scalar::all</a>(-DBL_MAX) for dilation. </p>
</div>
</div>
<a id="ga67493776e3ad1a3df63883829375201f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga67493776e3ad1a3df63883829375201f">◆ </a></span>morphologyEx()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::morphologyEx </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>op</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>kernel</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> </td>
          <td class="paramname"><em>anchor</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>(-1,-1)</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>iterations</em> = <code>1</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>borderType</em> = <code><a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5aed2e4346047e265c8c5a6d0276dcd838">BORDER_CONSTANT</a></code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a> &amp; </td>
          <td class="paramname"><em>borderValue</em> = <code><a class="el" href="../../d4/d86/group__imgproc__filter.html#ga94756fad83d9d24d29c9bf478558c40a">morphologyDefaultBorderValue</a>()</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.morphologyEx(</td><td class="paramname">src, op, kernel[, dst[, anchor[, iterations[, borderType[, borderValue]]]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Performs advanced morphological transformations. </p>
<p>The function <a class="el" href="../../d4/d86/group__imgproc__filter.html#ga67493776e3ad1a3df63883829375201f" title="Performs advanced morphological transformations. ">cv::morphologyEx</a> can perform advanced morphological transformations using an erosion and dilation as basic operations.</p>
<p>Any of the operations can be done in-place. In case of multi-channel images, each channel is processed independently.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>Source image. The number of channels can be arbitrary. The depth should be one of CV_8U, CV_16U, CV_16S, CV_32F or CV_64F. </td></tr>
    <tr><td class="paramname">dst</td><td>Destination image of the same size and type as source image. </td></tr>
    <tr><td class="paramname">op</td><td>Type of a morphological operation, see <a class="el" href="../../d4/d86/group__imgproc__filter.html#ga7be549266bad7b2e6a04db49827f9f32" title="type of morphological operation ">MorphTypes</a> </td></tr>
    <tr><td class="paramname">kernel</td><td>Structuring element. It can be created using <a class="el" href="../../d4/d86/group__imgproc__filter.html#gac342a1bb6eabf6f55c803b09268e36dc" title="Returns a structuring element of the specified size and shape for morphological operations. ">getStructuringElement</a>. </td></tr>
    <tr><td class="paramname">anchor</td><td>Anchor position with the kernel. Negative values mean that the anchor is at the kernel center. </td></tr>
    <tr><td class="paramname">iterations</td><td>Number of times erosion and dilation are applied. </td></tr>
    <tr><td class="paramname">borderType</td><td>Pixel extrapolation method, see <a class="el" href="../../d2/de8/group__core__array.html#ga209f2f4869e304c82d07739337eae7c5">BorderTypes</a>. <a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5a697c1b011884a7c2bdc0e5caf7955661" title="cdefgh|abcdefgh|abcdefg ">BORDER_WRAP</a> is not supported. </td></tr>
    <tr><td class="paramname">borderValue</td><td>Border value in case of a constant border. The default value has a special meaning. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d4/d86/group__imgproc__filter.html#ga4ff0f3318642c4f469d0e11f242f3b6c" title="Dilates an image by using a specific structuring element. ">dilate</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#gaeb1e0c1033e3f6b891a25d0511362aeb" title="Erodes an image by using a specific structuring element. ">erode</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#gac342a1bb6eabf6f55c803b09268e36dc" title="Returns a structuring element of the specified size and shape for morphological operations. ">getStructuringElement</a> </dd></dl>
<dl class="section note"><dt>Note</dt><dd>The number of iterations is the number of times erosion or dilatation operation will be applied. For instance, an opening operation (<a class="el" href="../../d4/d86/group__imgproc__filter.html#gga7be549266bad7b2e6a04db49827f9f32a08d3cc3a2ace00cec488966d31fa29ea">MORPH_OPEN</a>) with two iterations is equivalent to apply successively: erode -&gt; erode -&gt; dilate -&gt; dilate (and not erode -&gt; dilate -&gt; erode -&gt; dilate). </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../da/d34/samples_2cpp_2tutorial_code_2ImgProc_2Morphology_2_8cpp-example.html#a13">samples/cpp/tutorial_code/ImgProc/Morphology_2.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="gaf9bba239dfca11654cb7f50f889fc2ff"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf9bba239dfca11654cb7f50f889fc2ff">◆ </a></span>pyrDown()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::pyrDown </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> &amp; </td>
          <td class="paramname"><em>dstsize</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>borderType</em> = <code><a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a></code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.pyrDown(</td><td class="paramname">src[, dst[, dstsize[, borderType]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Blurs an image and downsamples it. </p>
<p>By default, size of the output image is computed as <code>Size((src.cols+1)/2, (src.rows+1)/2)</code>, but in any case, the following conditions should be satisfied:</p>
<p class="formulaDsp">
\[\begin{array}{l} | \texttt{dstsize.width} *2-src.cols| \leq 2 \\ | \texttt{dstsize.height} *2-src.rows| \leq 2 \end{array}\]
</p>
<p>The function performs the downsampling step of the Gaussian pyramid construction. First, it convolves the source image with the kernel:</p>
<p class="formulaDsp">
\[\frac{1}{256} \begin{bmatrix} 1 &amp; 4 &amp; 6 &amp; 4 &amp; 1 \\ 4 &amp; 16 &amp; 24 &amp; 16 &amp; 4 \\ 6 &amp; 24 &amp; 36 &amp; 24 &amp; 6 \\ 4 &amp; 16 &amp; 24 &amp; 16 &amp; 4 \\ 1 &amp; 4 &amp; 6 &amp; 4 &amp; 1 \end{bmatrix}\]
</p>
<p>Then, it downsamples the image by rejecting even rows and columns.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>input image. </td></tr>
    <tr><td class="paramname">dst</td><td>output image; it has the specified size and the same type as src. </td></tr>
    <tr><td class="paramname">dstsize</td><td>size of the output image. </td></tr>
    <tr><td class="paramname">borderType</td><td>Pixel extrapolation method, see <a class="el" href="../../d2/de8/group__core__array.html#ga209f2f4869e304c82d07739337eae7c5">BorderTypes</a> (<a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5aed2e4346047e265c8c5a6d0276dcd838" title="iiiiii|abcdefgh|iiiiiii with some specified i ">BORDER_CONSTANT</a> isn't supported) </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../db/d00/samples_2cpp_2squares_8cpp-example.html#a8">samples/cpp/squares.cpp</a>, <a class="el" href="../../d3/d08/samples_2cpp_2tutorial_code_2ImgProc_2Pyramids_2Pyramids_8cpp-example.html#a10">samples/cpp/tutorial_code/ImgProc/Pyramids/Pyramids.cpp</a>, and <a class="el" href="../../de/dc0/samples_2tapi_2squares_8cpp-example.html#a7">samples/tapi/squares.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="ga9fabdce9543bd602445f5db3827e4cc0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9fabdce9543bd602445f5db3827e4cc0">◆ </a></span>pyrMeanShiftFiltering()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::pyrMeanShiftFiltering </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>sp</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>sr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>maxLevel</em> = <code>1</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html">TermCriteria</a> </td>
          <td class="paramname"><em>termcrit</em> = <code><a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html">TermCriteria</a>(<a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html#a56fecdc291ccaba8aad27d67ccf72c57a56ca2bc5cd06345060a1c1c66a8fc06e">TermCriteria::MAX_ITER</a>+<a class="el" href="../../d9/d5d/classcv_1_1TermCriteria.html#a56fecdc291ccaba8aad27d67ccf72c57a857609e73e7028e638d2ea649f3b45d5">TermCriteria::EPS</a>, 5, 1)</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.pyrMeanShiftFiltering(</td><td class="paramname">src, sp, sr[, dst[, maxLevel[, termcrit]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Performs initial step of meanshift segmentation of an image. </p>
<p>The function implements the filtering stage of meanshift segmentation, that is, the output of the function is the filtered "posterized" image with color gradients and fine-grain texture flattened. At every pixel (X,Y) of the input image (or down-sized input image, see below) the function executes meanshift iterations, that is, the pixel (X,Y) neighborhood in the joint space-color hyperspace is considered:</p>
<p class="formulaDsp">
\[(x,y): X- \texttt{sp} \le x \le X+ \texttt{sp} , Y- \texttt{sp} \le y \le Y+ \texttt{sp} , ||(R,G,B)-(r,g,b)|| \le \texttt{sr}\]
</p>
<p>where (R,G,B) and (r,g,b) are the vectors of color components at (X,Y) and (x,y), respectively (though, the algorithm does not depend on the color space used, so any 3-component color space can be used instead). Over the neighborhood the average spatial value (X',Y') and average color vector (R',G',B') are found and they act as the neighborhood center on the next iteration:</p>
<p class="formulaDsp">
\[(X,Y)~(X',Y'), (R,G,B)~(R',G',B').\]
</p>
<p>After the iterations over, the color components of the initial pixel (that is, the pixel from where the iterations started) are set to the final value (average color at the last iteration):</p>
<p class="formulaDsp">
\[I(X,Y) &lt;- (R*,G*,B*)\]
</p>
<p>When maxLevel &gt; 0, the gaussian pyramid of maxLevel+1 levels is built, and the above procedure is run on the smallest layer first. After that, the results are propagated to the larger layer and the iterations are run again only on those pixels where the layer colors differ by more than sr from the lower-resolution layer of the pyramid. That makes boundaries of color regions sharper. Note that the results will be actually different from the ones obtained by running the meanshift procedure on the whole original image (i.e. when maxLevel==0).</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>The source 8-bit, 3-channel image. </td></tr>
    <tr><td class="paramname">dst</td><td>The destination image of the same format and the same size as the source. </td></tr>
    <tr><td class="paramname">sp</td><td>The spatial window radius. </td></tr>
    <tr><td class="paramname">sr</td><td>The color window radius. </td></tr>
    <tr><td class="paramname">maxLevel</td><td>Maximum level of the pyramid for the segmentation. </td></tr>
    <tr><td class="paramname">termcrit</td><td>Termination criteria: when to stop meanshift iterations. </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<a id="gada75b59bdaaca411ed6fee10085eb784"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gada75b59bdaaca411ed6fee10085eb784">◆ </a></span>pyrUp()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::pyrUp </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> &amp; </td>
          <td class="paramname"><em>dstsize</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>borderType</em> = <code><a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a></code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.pyrUp(</td><td class="paramname">src[, dst[, dstsize[, borderType]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Upsamples an image and then blurs it. </p>
<p>By default, size of the output image is computed as <code>Size(src.cols\*2, (src.rows\*2)</code>, but in any case, the following conditions should be satisfied:</p>
<p class="formulaDsp">
\[\begin{array}{l} | \texttt{dstsize.width} -src.cols*2| \leq ( \texttt{dstsize.width} \mod 2) \\ | \texttt{dstsize.height} -src.rows*2| \leq ( \texttt{dstsize.height} \mod 2) \end{array}\]
</p>
<p>The function performs the upsampling step of the Gaussian pyramid construction, though it can actually be used to construct the Laplacian pyramid. First, it upsamples the source image by injecting even zero rows and columns and then convolves the result with the same kernel as in pyrDown multiplied by 4.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>input image. </td></tr>
    <tr><td class="paramname">dst</td><td>output image. It has the specified size and the same type as src . </td></tr>
    <tr><td class="paramname">dstsize</td><td>size of the output image. </td></tr>
    <tr><td class="paramname">borderType</td><td>Pixel extrapolation method, see <a class="el" href="../../d2/de8/group__core__array.html#ga209f2f4869e304c82d07739337eae7c5">BorderTypes</a> (only <a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01" title="same as BORDER_REFLECT_101 ">BORDER_DEFAULT</a> is supported) </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../db/d00/samples_2cpp_2squares_8cpp-example.html#a12">samples/cpp/squares.cpp</a>, <a class="el" href="../../d3/d08/samples_2cpp_2tutorial_code_2ImgProc_2Pyramids_2Pyramids_8cpp-example.html#a6">samples/cpp/tutorial_code/ImgProc/Pyramids/Pyramids.cpp</a>, and <a class="el" href="../../de/dc0/samples_2tapi_2squares_8cpp-example.html#a11">samples/tapi/squares.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="gaa13106761eedf14798f37aa2d60404c9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa13106761eedf14798f37aa2d60404c9">◆ </a></span>Scharr()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::Scharr </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>ddepth</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>dx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>dy</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>scale</em> = <code>1</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>delta</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>borderType</em> = <code><a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a></code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.Scharr(</td><td class="paramname">src, ddepth, dx, dy[, dst[, scale[, delta[, borderType]]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Calculates the first x- or y- image derivative using Scharr operator. </p>
<p>The function computes the first x- or y- spatial image derivative using the Scharr operator. The call</p>
<p class="formulaDsp">
\[\texttt{Scharr(src, dst, ddepth, dx, dy, scale, delta, borderType)}\]
</p>
<p>is equivalent to</p>
<p class="formulaDsp">
\[\texttt{Sobel(src, dst, ddepth, dx, dy, FILTER_SCHARR, scale, delta, borderType)} .\]
</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>input image. </td></tr>
    <tr><td class="paramname">dst</td><td>output image of the same size and the same number of channels as src. </td></tr>
    <tr><td class="paramname">ddepth</td><td>output image depth, see <a class="el" href="../../d4/d86/group__imgproc__filter.html#filter_depths">combinations</a> </td></tr>
    <tr><td class="paramname">dx</td><td>order of the derivative x. </td></tr>
    <tr><td class="paramname">dy</td><td>order of the derivative y. </td></tr>
    <tr><td class="paramname">scale</td><td>optional scale factor for the computed derivative values; by default, no scaling is applied (see <a class="el" href="../../d4/d86/group__imgproc__filter.html#ga6d6c23f7bd3f5836c31cfae994fc4aea" title="Returns filter coefficients for computing spatial image derivatives. ">getDerivKernels</a> for details). </td></tr>
    <tr><td class="paramname">delta</td><td>optional delta value that is added to the results prior to storing them in dst. </td></tr>
    <tr><td class="paramname">borderType</td><td>pixel extrapolation method, see <a class="el" href="../../d2/de8/group__core__array.html#ga209f2f4869e304c82d07739337eae7c5">BorderTypes</a>. <a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5a697c1b011884a7c2bdc0e5caf7955661" title="cdefgh|abcdefgh|abcdefg ">BORDER_WRAP</a> is not supported. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d2/de8/group__core__array.html#gac5f92f48ec32cacf5275969c33ee837d" title="Calculates the magnitude and angle of 2D vectors. ">cartToPolar</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d6/d56/samples_2cpp_2edge_8cpp-example.html#a7">samples/cpp/edge.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="ga910e29ff7d7b105057d1625a4bf6318d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga910e29ff7d7b105057d1625a4bf6318d">◆ </a></span>sepFilter2D()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::sepFilter2D </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>ddepth</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>kernelX</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>kernelY</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> </td>
          <td class="paramname"><em>anchor</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>(-1,-1)</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>delta</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>borderType</em> = <code><a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a></code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.sepFilter2D(</td><td class="paramname">src, ddepth, kernelX, kernelY[, dst[, anchor[, delta[, borderType]]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Applies a separable linear filter to an image. </p>
<p>The function applies a separable linear filter to the image. That is, first, every row of src is filtered with the 1D kernel kernelX. Then, every column of the result is filtered with the 1D kernel kernelY. The final result shifted by delta is stored in dst .</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>Source image. </td></tr>
    <tr><td class="paramname">dst</td><td>Destination image of the same size and the same number of channels as src . </td></tr>
    <tr><td class="paramname">ddepth</td><td>Destination image depth, see <a class="el" href="../../d4/d86/group__imgproc__filter.html#filter_depths">combinations</a> </td></tr>
    <tr><td class="paramname">kernelX</td><td>Coefficients for filtering each row. </td></tr>
    <tr><td class="paramname">kernelY</td><td>Coefficients for filtering each column. </td></tr>
    <tr><td class="paramname">anchor</td><td>Anchor position within the kernel. The default value \((-1,-1)\) means that the anchor is at the kernel center. </td></tr>
    <tr><td class="paramname">delta</td><td>Value added to the filtered results before storing them. </td></tr>
    <tr><td class="paramname">borderType</td><td>Pixel extrapolation method, see <a class="el" href="../../d2/de8/group__core__array.html#ga209f2f4869e304c82d07739337eae7c5">BorderTypes</a>. <a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5a697c1b011884a7c2bdc0e5caf7955661" title="cdefgh|abcdefgh|abcdefg ">BORDER_WRAP</a> is not supported. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d4/d86/group__imgproc__filter.html#ga27c049795ce870216ddfb366086b5a04" title="Convolves an image with the kernel. ">filter2D</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#gacea54f142e81b6758cb6f375ce782c8d" title="Calculates the first, second, third, or mixed image derivatives using an extended Sobel operator...">Sobel</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#gaabe8c836e97159a9193fb0b11ac52cf1" title="Blurs an image using a Gaussian filter. ">GaussianBlur</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#gad533230ebf2d42509547d514f7d3fbc3" title="Blurs an image using the box filter. ">boxFilter</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#ga8c45db9afe636703801b0b2e440fce37" title="Blurs an image using the normalized box filter. ">blur</a> </dd></dl>
</div>
</div>
<a id="gacea54f142e81b6758cb6f375ce782c8d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacea54f142e81b6758cb6f375ce782c8d">◆ </a></span>Sobel()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::Sobel </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>ddepth</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>dx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>dy</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>ksize</em> = <code>3</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>scale</em> = <code>1</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>delta</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>borderType</em> = <code><a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a></code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.Sobel(</td><td class="paramname">src, ddepth, dx, dy[, dst[, ksize[, scale[, delta[, borderType]]]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Calculates the first, second, third, or mixed image derivatives using an extended Sobel operator. </p>
<p>In all cases except one, the \(\texttt{ksize} \times \texttt{ksize}\) separable kernel is used to calculate the derivative. When \(\texttt{ksize = 1}\), the \(3 \times 1\) or \(1 \times 3\) kernel is used (that is, no Gaussian smoothing is done). <code>ksize = 1</code> can only be used for the first or the second x- or y- derivatives.</p>
<p>There is also the special value <code>ksize = <a class="el" href="../../d4/d86/group__imgproc__filter.html#ggad8e695e87dee497e227716576c244598a460c815d2bb921fb7f53f4220e19c1d5">FILTER_SCHARR</a> (-1)</code> that corresponds to the \(3\times3\) Scharr filter that may give more accurate results than the \(3\times3\) Sobel. The Scharr aperture is</p>
<p class="formulaDsp">
\[\vecthreethree{-3}{0}{3}{-10}{0}{10}{-3}{0}{3}\]
</p>
<p>for the x-derivative, or transposed for the y-derivative.</p>
<p>The function calculates an image derivative by convolving the image with the appropriate kernel:</p>
<p class="formulaDsp">
\[\texttt{dst} = \frac{\partial^{xorder+yorder} \texttt{src}}{\partial x^{xorder} \partial y^{yorder}}\]
</p>
<p>The Sobel operators combine Gaussian smoothing and differentiation, so the result is more or less resistant to the noise. Most often, the function is called with ( xorder = 1, yorder = 0, ksize = 3) or ( xorder = 0, yorder = 1, ksize = 3) to calculate the first x- or y- image derivative. The first case corresponds to a kernel of:</p>
<p class="formulaDsp">
\[\vecthreethree{-1}{0}{1}{-2}{0}{2}{-1}{0}{1}\]
</p>
<p>The second case corresponds to a kernel of:</p>
<p class="formulaDsp">
\[\vecthreethree{-1}{-2}{-1}{0}{0}{0}{1}{2}{1}\]
</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>input image. </td></tr>
    <tr><td class="paramname">dst</td><td>output image of the same size and the same number of channels as src . </td></tr>
    <tr><td class="paramname">ddepth</td><td>output image depth, see <a class="el" href="../../d4/d86/group__imgproc__filter.html#filter_depths">combinations</a>; in the case of 8-bit input images it will result in truncated derivatives. </td></tr>
    <tr><td class="paramname">dx</td><td>order of the derivative x. </td></tr>
    <tr><td class="paramname">dy</td><td>order of the derivative y. </td></tr>
    <tr><td class="paramname">ksize</td><td>size of the extended Sobel kernel; it must be 1, 3, 5, or 7. </td></tr>
    <tr><td class="paramname">scale</td><td>optional scale factor for the computed derivative values; by default, no scaling is applied (see <a class="el" href="../../d4/d86/group__imgproc__filter.html#ga6d6c23f7bd3f5836c31cfae994fc4aea" title="Returns filter coefficients for computing spatial image derivatives. ">getDerivKernels</a> for details). </td></tr>
    <tr><td class="paramname">delta</td><td>optional delta value that is added to the results prior to storing them in dst. </td></tr>
    <tr><td class="paramname">borderType</td><td>pixel extrapolation method, see <a class="el" href="../../d2/de8/group__core__array.html#ga209f2f4869e304c82d07739337eae7c5">BorderTypes</a>. <a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5a697c1b011884a7c2bdc0e5caf7955661" title="cdefgh|abcdefgh|abcdefg ">BORDER_WRAP</a> is not supported. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d4/d86/group__imgproc__filter.html#gaa13106761eedf14798f37aa2d60404c9" title="Calculates the first x- or y- image derivative using Scharr operator. ">Scharr</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#gad78703e4c8fe703d479c1860d76429e6" title="Calculates the Laplacian of an image. ">Laplacian</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#ga910e29ff7d7b105057d1625a4bf6318d" title="Applies a separable linear filter to an image. ">sepFilter2D</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#ga27c049795ce870216ddfb366086b5a04" title="Convolves an image with the kernel. ">filter2D</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#gaabe8c836e97159a9193fb0b11ac52cf1" title="Blurs an image using a Gaussian filter. ">GaussianBlur</a>, <a class="el" href="../../d2/de8/group__core__array.html#gac5f92f48ec32cacf5275969c33ee837d" title="Calculates the magnitude and angle of 2D vectors. ">cartToPolar</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d3/d94/samples_2cpp_2tutorial_code_2ImgTrans_2Sobel_Demo_8cpp-example.html#a14">samples/cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="ga405d03b20c782b65a4daf54d233239a2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga405d03b20c782b65a4daf54d233239a2">◆ </a></span>spatialGradient()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::spatialGradient </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dy</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>ksize</em> = <code>3</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>borderType</em> = <code><a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a></code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dx, dy</td><td>=</td><td>cv.spatialGradient(</td><td class="paramname">src[, dx[, dy[, ksize[, borderType]]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Calculates the first order image derivative in both x and y using a Sobel operator. </p>
<p>Equivalent to calling:</p>
<div class="fragment"><div class="line"><a class="code" href="../../d4/d86/group__imgproc__filter.html#gacea54f142e81b6758cb6f375ce782c8d">Sobel</a>( src, dx, <a class="code" href="../../d1/d1b/group__core__hal__interface.html#ga3515053e24377cf079fa1027d208ad52">CV_16SC1</a>, 1, 0, 3 );</div><div class="line"><a class="code" href="../../d4/d86/group__imgproc__filter.html#gacea54f142e81b6758cb6f375ce782c8d">Sobel</a>( src, dy, <a class="code" href="../../d1/d1b/group__core__hal__interface.html#ga3515053e24377cf079fa1027d208ad52">CV_16SC1</a>, 0, 1, 3 );</div></div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>input image. </td></tr>
    <tr><td class="paramname">dx</td><td>output image with first-order derivative in x. </td></tr>
    <tr><td class="paramname">dy</td><td>output image with first-order derivative in y. </td></tr>
    <tr><td class="paramname">ksize</td><td>size of Sobel kernel. It must be 3. </td></tr>
    <tr><td class="paramname">borderType</td><td>pixel extrapolation method, see <a class="el" href="../../d2/de8/group__core__array.html#ga209f2f4869e304c82d07739337eae7c5">BorderTypes</a>. Only <a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01" title="same as BORDER_REFLECT_101 ">BORDER_DEFAULT</a>=<a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5ab3c5a6143d8120b95005fa7105a10bb4" title="gfedcb|abcdefgh|gfedcba ">BORDER_REFLECT_101</a> and <a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5aa1de4cff95e3377d6d0cbe7569bd4e9f" title="aaaaaa|abcdefgh|hhhhhhh ">BORDER_REPLICATE</a> are supported.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d4/d86/group__imgproc__filter.html#gacea54f142e81b6758cb6f375ce782c8d" title="Calculates the first, second, third, or mixed image derivatives using an extended Sobel operator...">Sobel</a> </dd></dl>
</div>
</div>
<a id="ga76e863e7869912edbe88321253b72688"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga76e863e7869912edbe88321253b72688">◆ </a></span>sqrBoxFilter()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::sqrBoxFilter </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>ddepth</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> </td>
          <td class="paramname"><em>ksize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> </td>
          <td class="paramname"><em>anchor</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>(-1, -1)</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool </td>
          <td class="paramname"><em>normalize</em> = <code>true</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>borderType</em> = <code><a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5afe14c13a4ea8b8e3b3ef399013dbae01">BORDER_DEFAULT</a></code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.sqrBoxFilter(</td><td class="paramname">src, ddepth, ksize[, dst[, anchor[, normalize[, borderType]]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Calculates the normalized sum of squares of the pixel values overlapping the filter. </p>
<p>For every pixel \( (x, y) \) in the source image, the function calculates the sum of squares of those neighboring pixel values which overlap the filter placed over the pixel \( (x, y) \).</p>
<p>The unnormalized square box filter can be useful in computing local image statistics such as the the local variance and standard deviation around the neighborhood of a pixel.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>input image </td></tr>
    <tr><td class="paramname">dst</td><td>output image of the same size and type as _src </td></tr>
    <tr><td class="paramname">ddepth</td><td>the output image depth (-1 to use <a class="el" href="../../d0/daf/group__projection.html#ga8b5e5413af41caf3f2a0bbf4cdf517a8" title="Returns the depth of a point transformed by a rigid transform. ">src.depth()</a>) </td></tr>
    <tr><td class="paramname">ksize</td><td>kernel size </td></tr>
    <tr><td class="paramname">anchor</td><td>kernel anchor point. The default value of Point(-1, -1) denotes that the anchor is at the kernel center. </td></tr>
    <tr><td class="paramname">normalize</td><td>flag, specifying whether the kernel is to be normalized by it's area or not. </td></tr>
    <tr><td class="paramname">borderType</td><td>border mode used to extrapolate pixels outside of the image, see <a class="el" href="../../d2/de8/group__core__array.html#ga209f2f4869e304c82d07739337eae7c5">BorderTypes</a>. <a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5a697c1b011884a7c2bdc0e5caf7955661" title="cdefgh|abcdefgh|abcdefg ">BORDER_WRAP</a> is not supported. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d4/d86/group__imgproc__filter.html#gad533230ebf2d42509547d514f7d3fbc3" title="Blurs an image using the box filter. ">boxFilter</a> </dd></dl>
</div>
</div>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.6-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 2 2021 11:36:40 for OpenCV by  <a href="http://www.doxygen.org/index.html">
<img alt="doxygen" class="footer" src="../../doxygen.png"/>
</a> 1.8.13
</small></address>
<script type="text/javascript">
//<![CDATA[
addTutorialsButtons();
//]]>
</script>
</body>
</html>
